<script setup lang="ts">
import { Comp1, Comp5, Comp7, Comp8, Comp9, Comp1061, Comp46, Comp61, Comp1002, Comp1001, YkEbsFlow } from 'yklib'

const components = [
  Comp1, Comp5, Comp7, Comp8, Comp9, Comp61, Comp1061, Comp46, Comp1001, Comp1002
]

const stData = localStorage.getItem('EbsFlow') // 加载浏览器缓存
let stDataObj: any = null
if (stData) {
  stDataObj = JSON.parse(stData)
}

const data = stDataObj?.modelData || {
  // 节点
  nodes: [
    {
      id: 'node2',
      type: '换热器',
      x: 400,
      y: 400,
      // text: '你好',
      resizable: true,
      properties: {
        status: 'reject'
      }
    },
    {
      id: 'node3',
      type: '测量点',
      x: 600,
      y: 385,
      properties: {
        status: 'on'
      }
    },
    {
      id: 'node1',
      type: '边界值',
      x: 100,
      y: 400,
      properties: {}
    }


  ],
  // 边
  edges: [
    {
      type: 'EbsEdge',
      sourceNodeId: 'node2',
      sourceAnchorId: 'node2_2',
      targetNodeId: 'node3',
      targetAnchorId: 'node3_1'
    }
  ]
}
</script>

<template>
  <YkEbsFlow :components="components" :data="data"></YkEbsFlow>
</template>

<style scoped>

</style>